<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use common\models\Course;
?>
<script type="text/javascript" src="js/jquery.flexslider-min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $('.flexslider').flexslider({
            directionNav: true,
            pauseOnAction: false
        });
    });
</script>
<?= \Yii::$app->view->renderFile('@app/views/layouts/header.php'); ?>
<div class="clear"></div>
<!--header 结束-->
  <!-- header 结束 -->  

<div class="sy_main">
<div class="wrapin">
<div class="page">
<!--page 开始-->
<div class="page_left">
<div class="page_left_title"><span>单位概况</span></div>
<div class="page_left_main">

<li><a href="/about.aspx?id=1"><span>所况简介</span></a></li>

<li><a href="/about.aspx?id=2"><span>所长致辞</span></a></li>

<li><a href="/leader.aspx?category_id=3"><span>领导信息</span></a></li>

<li><a href="/about.aspx?id=4"><span>历史沿革</span></a></li>

<li><a href="/leader2.aspx?category_id=5"><span>领导关怀</span></a></li>

<li><a href="/contact.aspx?id=6"><span>联系方式</span></a></li>

</div>
</div>
<!--page_left 结束-->
<div class="page_right">
<div class="page_right_main">

<div class="page_right_title">课程报名</div>
<div class="page_right_content">

<div class="about">
<!-- Button trigger modal -->

  <div class="row">
    <?php foreach($course as $v) {?>
    <div class="col-sm-6 col-md-4">
        <div class="thumbnail">
        <img style="height:130px;" src="<?= $v['thumb']?>" alt="...">
            <div class="caption">
            <h3 class="text-center text-danger"><?= $v->title?></h3>
            <p class="text-center">价格：<strong class="text-danger"><?= $v->price?></strong> 元</p>
                <p><a href="#" class="btn btn-primary btn-block" data-toggle="modal" data-target="#myModal">我要报名</a></p>
            </div>
        </div>
    </div>
    <?php }?>

  </div>
</div>

</div>
</div>
</div>
<!--page_right 结束-->

<!--page 结束-->
</div>
</div>
</div>

<!-- 弹出表单 -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel" style="font-size:18px;">网上报名</h4>
      </div>
        <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]) ?>
      <div class="modal-body">

        <?= $form->field($model, 'cid')->dropDownList(
          ArrayHelper::map(Course::find()->all(), 'id', 'title'),
          ['prompt' => '选择分类']
        ) ?>

        <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>


        <?= $form->field($model, 'tel')->textInput()?>

      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <?= Html::submitButton('提交报名', ['class' => 'btn btn-success']) ?>
      </div>
        <?php ActiveForm::end(); ?>
    </div>
  </div>
</div>
 <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<?= \Yii::$app->view->renderFile('@app/views/layouts/footer.php'); ?>
